Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Feb 12, 2020

Changed plugin.py to enable debug on the event loop fixture.

This allows any tasks that are not closed correctly to be logged
in such a way that we can see which test they originate from,
which is incredibly useful in testing large libraries where a test
somewhere may not be awaiting something correctly or may be
closing the event loop without terminating tasks correctly.

Changed plugin.py to enable debug on the event loop fixture.

This allows any tasks that are not closed correctly to be logged 
in such a way that we can see which test they originate from, 
which is incredibly useful in testing large libraries where a test
somewhere may not be awaiting something correctly or may be
closing the event loop without terminating tasks correctly.
@simonfagerholm
Copy link
Contributor

@nekokatt Maybe it should be possible to turn this off and on, debugging code permanently on could possibly annoy users.

@ghost
Copy link
Author

ghost commented Apr 22, 2020

Arent these warnings almost always an indicator that your tests have issues that can affect how they operate, though?

@simonfagerholm
Copy link
Contributor

That is possible, I was reflecting over that it is an option on the loop and not the default behavior.
If it raises new warnings for people that don't care about them I think they will start creating issues about it.

Will this not also show warnings from other parts except the tests, like all asyncio code?

@Tinche
Copy link
Member

Tinche commented Apr 22, 2020

How does this relate to setting the environment variable PYTHONASYNCIODEBUG = 1?

@simonfagerholm
Copy link
Contributor

simonfagerholm commented Apr 22, 2020

Good point, it seems this can be achieved without change in pytest-asyncio by setting the environment variable in systems where it is wanted

@asvetlov
Copy link
Contributor

asvetlov commented Jan 5, 2022

The PR should be closed I guess.

@Tinche Tinche closed this Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants